package ru.geyes.screw.collections;

import ru.geyes.screw.closures.Function1B;
import ru.geyes.screw.closures.Function1;
import ru.geyes.screw.closures.Function1V;
import ru.geyes.screw.tuples.Tuple;
import ru.geyes.screw.tuples.Tuple2;

import java.util.List;

/**
 * @author alex
 *         date 17.05.2008
 *         time 21:24:35
 */
public interface ListXF<T> {
    public List<T> getList();
    public Option<T> getFirst();
    public Option<T> getLast();
    public ListX<T> filter(Function1B<T> filterF);
    public <F> ListX<F> map(Function1<F, T> mapperF);
    public <F> MapX<F, T> map2Map(Function1<Tuple2<F, T>, T> mapperF);
    public void foreach(Function1V<T> f);

    public ListX<T> cloneList();


    public ListX<T> append(T o);
    public ListX<T> insert(T o, int pos);
    public ListX<T> push(T o);

    public ListX<T> appendUnmod(T o);
    public ListX<T> insertUnmod(T o, int pos);
    public ListX<T> pushUnmod(T o);

}
